POST-PHASE12: Combining Two G2K projects
Summary:
- This phase is to combine/merge/stitch two separate G2K projects into one.
- Hence, one large geographical area could be solved by splitting it into set of connected smaller sub-areas (touching each other)
- The smaller sub-areas are independent G2K projects that could be executed (all phases) indepependent to each other and hence horizontally scaled.
- All steps upto "STEP14: Import inter-traversal links from secondary-scope DB", could be performed parallely for multiple scopes
- Also, solving a large area into N sub-areas will get solved faster and with less resources (cache and CPUs can be much small)
- This phase takes one central/main/primary G2K project and another secondary G2K project and combine them --
- in such a way that clusters/nodes/links/connectors of secondary G2K project is included into primary/main G2K project.
- The resultant combined/merged G2K project could be used to find routes over the merged, larger area
Before merging two projects:

Ref: zone-to-zone-routes-without-g2y-merged-with-g2k-scope.png
Assumptions:
- This phase documentation assumes that the PROD scope (of G2K) is the central/main/primary scope; and DEV scope (of G2Y) is the secondary one.
- Remote database access is setup in such a way that all necessary tables of database of one scope is readable to database of other scope.
High-level Description of Combining Two Projects
Please see the sketch of merging activity below:

Ref: sketch_on_merging_g2y_with_g2k.jpg
Observations:
- Both the scopes share one or more common intersecting boundaries (vertical line in the sketch)
- Both the scopes contain traversal clusters reaching very close (<=2km) to one of such intersecting boundary
- These traversal clusters contain nodes (blue or cyan colored circles in the sketch) that are very close (<=2km) to one of such intersecting boundary
- Among these nodes, there are ingres-nodes such that they have atleast one ingress edge each -- so that there would be some route that could reach these ingres-nodes
- Among these nodes, there are egres-nodes such that they have atleast one egress edge each -- so that there would be some route that could leave these egres-nodes
Merging Steps:
- Using Dijkstra algorithm, shortest-paths are found from each ingres-node to node that lie on the intersecting boundary (green colored line in the sketch)
- Similarly, shortest-paths are found from the node that lie on the intersecting boundary to each egres-node (orange colored line in the sketch)
- New Traversal Cluster Link is created for each ingres-node path and egres-node path WHEN both share common node on intersecting boundary. (Hence, Traversal Cluster Link will contain green colored line followed by orange colored line in the sketch -- using node on intersecting boundary as connector)
- All these Traversal Cluster Links are saved as edges in cluster-based graph (as shown by red colored lines in below post-merging sketch)
- With added cluster-edges, the cluster-based graph routing can traverse across both the scopes
- The nodes and edges of high-order graph of secondary scope are imported into main scope database -- so that the routing on main scope can search though node/edges of secondary scope graph
- The unique ids are appropriately added by unique offsets
Please see the sketch of post-merging below:

Ref: sketch_on_merging_by_linking_g2y_with_g2k.jpg
Post-Merging Steps:
- The "Build Waterway Geometries" and "Find Shortest Path" phases are redone for the rivers that cross between main/secondary scopes
- For e-g., Top-3 Ganga-to-Kavery routes, and Top-3 Ganga-to-Yamuna routes will be redone since Ganga and Yamuna rivers cross G2K and G2K scopes
- The "Build Waterway Geometries" and "Find Shortest Path" phases are redone for the rivers that are near-by rivers in main/secondary scopes but not crossing each other
- For e-g., Top-3 Sutlej-to-Yamuna routes will be computed since Sutlej and Yamuna rivers become adjacent in G2K and B2Y scopes
- Researched results that are published to G2K Jal-Sethu website is updated reflecting the updated Top-3 routes
After merging two projects:
After G2Y is merged with G2K, the Jal Sethu could allow you to find routes across these two projects

Ref: zone-to-zone-routes-after-g2y-merged-with-g2k-scope.png
After B2Y is merged with G2K, the Jal Sethu could allow you to find routes across these two projects

Ref: zone-to-zone-routes-after-b2y-merged-with-g2y-and-g2k-scope.png